package com.mz.ozy.mvp.model;

import android.content.Context;

import com.mz.ozy.constants.Constants;
import com.mz.ozy.net.RetrofitUtils;
import com.mz.ozy.utils.JsonUtils;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.ResponseBody;

/**
 * @author wansong
 * @description:
 * @date :2020/9/24 16:32
 */
public class ObShopModel {

    //获取欧花商城首页数据
    public Observable<ResponseBody> getObData(Context context) {
        Map<String, String> jsonObject = new HashMap<>();
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10204, JsonUtils.requestJsonDate(jsonObject), Constants.tokenId);
    }

    //欧花列表数据
    public Observable<ResponseBody> getDataList(Context context, String pageNo, String orderBy, String type, String content, String orderType) {
        Map<String, String> maps = new HashMap<>();
        maps.put("pageNo", pageNo);
        maps.put("pageSize", Constants.PageSize);
        maps.put("orderBy", orderBy);
        maps.put("type", type);
        maps.put("content", content);
        maps.put("orderType", orderType);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10320, JsonUtils.requestJsonDate(maps), Constants.tokenId);
    }
}
